home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 2.iso / dist / fw_libxml.idb / usr / freeware / include / gnome-xml / debugXML.h.z / debugXML.h
C/C++ Source or Header  |  2001-04-12  |  2KB  |  107 lines

  1. /*
  2.  * debugXML.h : Interfaces to a set of routines used for debugging the tree
  3.  *              produced by the XML parser.
  4.  *
  5.  * Daniel Veillard <Daniel.Veillard@w3.org>
  6.  */
  7.  
  8. #ifndef __DEBUG_XML__
  9. #define __DEBUG_XML__
  10. #include <stdio.h>
  11. #include "tree.h"
  12. #include "xpath.h"
  13.  
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17.  
  18. /*
  19.  * The standard Dump routines
  20.  */
  21. void    xmlDebugDumpString    (FILE *output,
  22.                  const xmlChar *str);
  23. void    xmlDebugDumpAttr    (FILE *output,
  24.                  xmlAttrPtr attr,
  25.                  int depth);
  26. void    xmlDebugDumpAttrList    (FILE *output,
  27.                  xmlAttrPtr attr,
  28.                  int depth);
  29. void    xmlDebugDumpOneNode    (FILE *output,
  30.                  xmlNodePtr node,
  31.                  int depth);
  32. void    xmlDebugDumpNode    (FILE *output,
  33.                  xmlNodePtr node,
  34.                  int depth);
  35. void    xmlDebugDumpNodeList    (FILE *output,
  36.                  xmlNodePtr node,
  37.                  int depth);
  38. void    xmlDebugDumpDocumentHead(FILE *output,
  39.                  xmlDocPtr doc);
  40. void    xmlDebugDumpDocument    (FILE *output,
  41.                  xmlDocPtr doc);
  42. void    xmlDebugDumpEntities    (FILE *output,
  43.                  xmlDocPtr doc);
  44. void    xmlLsOneNode        (FILE *output,
  45.                  xmlNodePtr node);
  46.  
  47. /****************************************************************
  48.  *                                *
  49.  *     The XML shell related structures and functions        *
  50.  *                                *
  51.  ****************************************************************/
  52.  
  53. /**
  54.  * xmlShellReadlineFunc:
  55.  * @prompt:  a string prompt
  56.  *
  57.  * This is a generic signature for the XML shell input function
  58.  *
  59.  * Returns a string which will be freed by the Shell
  60.  */
  61. typedef char * (* xmlShellReadlineFunc)(char *prompt);
  62.  
  63. /*
  64.  * The shell context itself
  65.  * TODO: add the defined function tables.
  66.  */
  67. typedef struct _xmlShellCtxt xmlShellCtxt;
  68. typedef xmlShellCtxt *xmlShellCtxtPtr;
  69. struct _xmlShellCtxt {
  70.     char *filename;
  71.     xmlDocPtr doc;
  72.     xmlNodePtr node;
  73.     xmlXPathContextPtr pctxt;
  74.     int loaded;
  75.     FILE *output;
  76.     xmlShellReadlineFunc input;
  77. };
  78.  
  79. /**
  80.  * xmlShellCmd:
  81.  * @ctxt:  a shell context
  82.  * @arg:  a string argument
  83.  * @node:  a first node
  84.  * @node2:  a second node
  85.  *
  86.  * This is a generic signature for the XML shell functions
  87.  *
  88.  * Returns an int, negative returns indicating errors
  89.  */
  90. typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
  91.                              char *arg,
  92.                  xmlNodePtr node,
  93.                  xmlNodePtr node2);
  94.  
  95. /*
  96.  * The Shell interface.
  97.  */
  98. void    xmlShell    (xmlDocPtr doc,
  99.              char *filename,
  100.              xmlShellReadlineFunc input,
  101.              FILE *output);
  102.              
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif /* __DEBUG_XML__ */
  107.